<template>
	<view>
		<view class="mine-bg">
			<view class="mine-top">
				<u-avatar :src="data.headimgurl" shape="circle" size='120rpx'></u-avatar>

				<view class="mine-right">
					<view class="name">	
						{{data.nickname}}
					</view>
					<view class="bottom">
						请填写资料
					</view>
				</view>
			</view>
			<view class="mine-mid">
				<!-- <view class="item">
					<view class="top">
						可用余额
					</view>
					<view class="bottom">
						0
					</view>
				</view> -->
				<view class="item">
					<view class="top">
						今日预估补贴
					</view>
					<view class="bottom">
						{{inCome.today_pay_income}}
					</view>
				</view>
				<view class="item">
					<view class="top">
						今日付款订单
					</view>
					<view class="bottom">
						{{inCome.today_pay_order_count}}
					</view>
				</view>
			</view>
			<view class="mine-msg">
				<u-notice-bar :text="msg"></u-notice-bar>
			</view>
			<view class="mine-title">
				常用功能
			</view>
            <view class="mine-cell">
            	<u-cell-group>
					  <template>
					  <u-cell icon="man-add-fill" title="邀请新用户" :isLink="true" v-show="isInvitation == 1"  url="/pages/mine/inviPoster"></u-cell>
					  <u-cell icon="attach" title="我的粉丝" :isLink="true" v-show="isInvitation == 1" url="/pages/mine/fans"></u-cell>    
					  </template>
					       		
						<u-cell icon="order" title="订单明细" :isLink="true" url="/pages/mine/order"></u-cell>
						<u-cell icon="zhifubao-circle-fill" title="提现" :isLink="true" url="/pages/mine/drawal"></u-cell>
            		</u-cell-group>
            </view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				msg: "2024年京东包礼金项目补贴已经结算到余额",
				data:[],
				inCome:[],
				isInvitation:2,
			}
		},
		onLoad() {
			this.getData()
		},
		methods: {
			getData(){
				this.$api.getUser().then(res=>{
					this.data = res,
					this.isInvitation =  res.invitation_status
					uni.setStorageSync('isInvitation', res.invitation_status);
				})
				this.$api.getIncome().then(res=>{
					this.inCome = res
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	.mine-title{
		font-size: 28rpx;
		margin:20rpx;
	}
	.mine-cell{
		background: #fff;
	/* 	margin: 0 20rpx;
		padding:10rpx 30rpx; */
	}
	.mine-mid {
		background: #fff;
		margin: 20rpx;
		margin-top: 50rpx;
		border-radius: 20rpx;
		display: flex;
		height: 200rpx;
		align-items: center;
		justify-content:center;

		.item {
			width: 45%;
			display: flex;
			flex-direction: column;
			align-items: center;
			font-size: 28rpx;
			gap: 20rpx;
		}
	}

	.mine-top {
		display: flex;
		margin: 0 20rpx;
		padding-top: 60rpx;
		align-items: center;
		gap: 30rpx;
		font-size: 24rpx;
		color: #666;

		.img {
			height: 140rpx;
			width: 140rpx;
			border-radius: 50%;
		}

		.name {
			font-size: 28rpx;
			color: #333;
			font-weight: bold;
			margin-bottom: 20rpx;
		}
	}

	.mine-bg {
		height: 100vh;
		padding: 0;
		background: #f6f6f6;
	}
</style>